#pragma once

#include "AbstractDataManager.h"




class CKnowlTypeTree;
enum CategoryType { Category_None = 0, Category_Article = 1, Category_Dict = 2,Cateogry_Psw = 3 };
struct Category
{
	CategoryType m_CateType;
	int			m_ID;
	int			m_MasterId;
	int			m_Parent;
	CString		m_strClass;
	CString		m_strCate;
	int			m_Icon;

};
typedef CAtlList<Category*> CategoryList;

class CCategoryManager : public CAbstractDataManager
{

public:
	CCategoryManager(void);
	virtual ~CCategoryManager(void);
public:
	bool Add(CKnowlTypeTree* pViewTree,Category* pCate);
	bool Add(Category* pCate);
	//int Add(int parent,CString strCategory,const char* strClassType);
	bool Load(CKnowlTypeTree* pViewTree,LPCTSTR strClassType,int nMasterId = -1);
	bool Remove(CKnowlTypeTree* pViewTree,int iClassID);
	bool Remove(int iClassID);
	bool Rename(CKnowlTypeTree* pViewTree,int iClassID,CString strCategory);
	bool Rename(int iClassID,CString strCategory);
	bool ChangeParent(int iParent,int iClassID);
	CategoryType GetCategoryType() const { return m_CategoryType;}
	CategoryList* GetCategoryList(const CString& strClassType,int nMasterId = -1);
private:
	CategoryType	m_CategoryType;
};

